﻿<%@ Page Language="VB" AutoEventWireup="false" CodeFile="ManageBrands.aspx.vb" Inherits="Arwani.Backend_ManageBrands" %>

<%@ Register src="Menu.ascx" tagname="Menu" tagprefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <link href="../css/admin/style.css" rel="stylesheet" type="text/css" />
    <title> Arwani Backend Panel</title>
    <script src="../js/jquery.min.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        function postSortOrder(sortOrder, tableName, whereID, valueID) {
            $('#div_result').html('<input  type="image" src="../images/loading.gif" />');
            $.post("UpdateSortOrder.aspx", { sortOrder: sortOrder, tableName: tableName, whereID: whereID, valueID: valueID }, function (data) {
                $('#div_result').html(data);
            });
        }
    
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="tablecontent">
    <table border="0" cellpadding="2" cellspacing="2" width="100%" align="center">
        <tr>
            <td align="center">
                 
                <uc1:Menu ID="Menu1" runat="server" />
                 
            </td>

        </tr>

        <tr>
        <td align="right" style="padding-right:100px;">
            
            <asp:LinkButton ID="lnkAddNewBrand" runat="server">Add New Brand</asp:LinkButton>&nbsp;&nbsp;&nbsp;
            <asp:LinkButton ID="lnkBackToDiv" runat="server">Back to Division</asp:LinkButton>&nbsp;&nbsp;
        </td>
        </tr
        <tr>

        <tr>
        <td align="center">
            <asp:Label ID="lblBrandDivHeading" runat="server" Font-Size="XX-Large" 
                Font-Underline="True" ForeColor="Black"></asp:Label>
        </td>
        </tr>
        <tr>

        <tr>
        <td align="center" style="height: 5px">
            &nbsp;</td>
         
        </tr>
        <tr>
        <td align="center">
                       <table border="0" align="center" cellspacing="4" cellpadding="3">
                <tr>
                    <td>
                       <asp:Label ID="lblSearchlabel" runat="server" Text="Search"></asp:Label>&nbsp;
                       </td>
                    <td>
                        <asp:TextBox ID="txtSearch" runat="server" CssClass="form-control" style="width:120px;"></asp:TextBox>
                    </td>
                    <td><asp:DropDownList ID="cboDivision" runat="server" AutoPostBack="True" CssClass="form-control select-tab">
                                </asp:DropDownList></td>
                    <td id="rdCategory" runat="server" visible="false"><asp:DropDownList ID="cboCategory" runat="server">
                                </asp:DropDownList></td>
                    <td>
                        <asp:LinkButton ID="lnkSearch" runat="server" Text="Filter Records"></asp:LinkButton>
                    </td>
                </tr>
            </table></td>
        </tr>
        <tr><td>&nbsp;</td></tr>
            <tr>
            <td align="center"><div id="div_result" style="color:Red"></div></td>
            </tr>
        <tr>  
               <td align="center">
            <asp:DataGrid ID="dgBrands" runat="server" AutoGenerateColumns="False" DataKeyField="brandid"
            AllowPaging="True" CellPadding="4" ForeColor="#333333" GridLines="None" CssClass="table">
                        <AlternatingItemStyle BackColor="White" />
                        <Columns>
                            <asp:TemplateColumn HeaderText="Logo">
                                
                                <ItemTemplate>
                                    <asp:Image ID="imglogo" Width="100" Height="100" ImageUrl='<%#getImage(DataBinder.Eval(Container.DataItem,"brandlogo")) %>' runat="server" />
                                </ItemTemplate>
                                             </asp:TemplateColumn> <asp:TemplateColumn  HeaderText="Brand Picture">
                                <ItemTemplate>
                                    <asp:Image ID="imgPic" Width="100" Height="100" ImageUrl='<%#getImage(DataBinder.Eval(Container.DataItem,"brandpic")) %>' runat="server" />
                                </ItemTemplate>
                            </asp:TemplateColumn>
                            <asp:BoundColumn DataField="brandid" HeaderText="Brand ID"></asp:BoundColumn>
                            <asp:BoundColumn DataField="brandname" HeaderText="Brand Name">   </asp:BoundColumn>
                             
                            
                             <asp:TemplateColumn HeaderText="Division / Categories">
                                <ItemTemplate>
                                    <asp:Label ID="lblBrandDivCat"  runat="server" Text='<%#getBrandDivCat(DataBinder.Eval(Container.DataItem,"brandid")) %>' ></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateColumn>
                            <asp:TemplateColumn HeaderText="Brand Category">
                                <ItemTemplate>                                    
                                    <asp:LinkButton ID="lnkDivCategory" runat="server" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"brandid") %>' CommandName="Manage">Manage</asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateColumn>
                            
                            <asp:TemplateColumn HeaderText="Sort Order">
                                <ItemTemplate>
                                    <asp:TextBox Width="30px" MaxLength="4" CssClass="form-control"  ID="txtSortOrder" runat="server" text='<%#DataBinder.Eval(Container.DataItem,"sortorder") %>' ></asp:TextBox>
                                </ItemTemplate>
                                <ItemStyle Width="30px"/>
                                   <HeaderStyle Width="70px"/>
                            </asp:TemplateColumn>
                            <asp:TemplateColumn>
                                <ItemTemplate>
                                    <asp:LinkButton ID="lnkEdit" runat="server" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"brandid") %>' CommandName="Edit">Edit</asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateColumn>
                            <asp:TemplateColumn>
                                <ItemTemplate>
                                    <asp:LinkButton ID="lnkDelete" runat="server" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"brandid") %>'  CommandName="Delete">Delete</asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateColumn>
                        </Columns>
                        <EditItemStyle BackColor="#2461BF" />
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle Font-Bold="True" BackColor="#507CD1" ForeColor="White" />
                        <ItemStyle BackColor="#EFF3FB" />
                        <PagerStyle HorizontalAlign="Center" 
                            Mode="NumericPages" VerticalAlign="Middle" BackColor="#2461BF" 
                            ForeColor="White" />
                        <SelectedItemStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    </asp:DataGrid>
        </td>
        </tr>
    </table>
    </div>
    </form>
</body>
</html>
